// 导入axios模块
import axios from '@/utils/axios'

// 获取用户频道列表
export const channels = () => {
  return axios({
    method: 'GET',
    url: '/app/v1_0/user/channels'
  })
}

// 获取频道新闻列表
export const articles = params => {
  return axios({
    method: 'GET',
    url: '/app/v1_1/articles',
    params
  })
}

// 获取全部频道列表
export const allChannels = () => {
  return axios({
    method: 'GET',
    url: '/app/v1_0/channels'
  })
}

// 删除指定用户频道
export const deleteChannels = channelId => {
  return axios({
    method: 'DELETE',
    url: `/app/v1_0/user/channels/${channelId}`
  })
}

// 用户修改频道列表(添加)
export const addChannels = channels => {
  return axios({
    method: 'PATCH',
    url: '/app/v1_0/user/channels',
    data: {
      channels
    }
  })
}
